package main

import (
    "net/http"
    "bytes"
    "encoding/json"
)

func postRet(ret *PostData) {    

    buf,_ := json.Marshal(ret)
    reader := bytes.NewReader(buf)
    resp, err := http.Post(g_config.postResApi, "application/json", reader)
    if err != nil {
        mainlog.Println("post report data failed.", g_config.postResApi, err)
        return
    }
    resp.Body.Close()
    if resp.StatusCode != http.StatusOK {
        mainlog.Println("report api return not 200.", g_config.postResApi, resp.Status)
        return
    }
    mainlog.Println("post data success.")
}